package com.ruoyi.shop.emporium.brand.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.common.domain.DtsAdmin;
import com.ruoyi.mall.common.domain.DtsBrand;
import com.ruoyi.mall.common.mapper.DtsBrandMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.emporium.brand.service.IDtsBrandService;

/**
 * 品牌商Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-17
 */
@Service
public class DtsBrandServiceImpl implements IDtsBrandService
{
    @Autowired
    private DtsBrandMapper dtsBrandMapper;

    /**
     * 查询品牌商
     *
     * @param id 品牌商主键
     * @return 品牌商
     */
    @Override
    public DtsBrand selectDtsBrandById(Long id)
    {
        return dtsBrandMapper.selectDtsBrandById(id);
    }

    /**
     * 查询品牌商列表
     *
     * @param dtsBrand 品牌商
     * @return 品牌商
     */
    @Override
    public List<DtsBrand> selectDtsBrandList(DtsBrand dtsBrand)
    {
        return dtsBrandMapper.selectDtsBrandList(dtsBrand);
    }

    @Override
    public List<DtsAdmin> selectDtsAdminBrandList() {
        return dtsBrandMapper.selectDtsAdminBrandList();
    }

    /**
     * 新增品牌商
     *
     * @param dtsBrand 品牌商
     * @return 结果
     */
    @Override
    public int insertDtsBrand(DtsBrand dtsBrand)
    {
        return dtsBrandMapper.insertDtsBrand(dtsBrand);
    }

    /**
     * 修改品牌商
     *
     * @param dtsBrand 品牌商
     * @return 结果
     */
    @Override
    public int updateDtsBrand(DtsBrand dtsBrand)
    {
        dtsBrand.setUpdateTime(DateUtils.getNowDate());
        return dtsBrandMapper.updateDtsBrand(dtsBrand);
    }

    /**
     * 批量删除品牌商
     *
     * @param ids 需要删除的品牌商主键
     * @return 结果
     */
    @Override
    public int deleteDtsBrandByIds(Long[] ids)
    {
        return dtsBrandMapper.deleteDtsBrandByIds(ids);
    }

    /**
     * 删除品牌商信息
     *
     * @param id 品牌商主键
     * @return 结果
     */
    @Override
    public int deleteDtsBrandById(Long id)
    {
        return dtsBrandMapper.deleteDtsBrandById(id);
    }
}
